diff -Naur madwifi-0.9.4.orig/Makefile madwifi-0.9.4/Makefile
--- madwifi-0.9.4.orig/Makefile	2007-12-14 06:40:22.000000000 +0000
+++ madwifi-0.9.4/Makefile	2009-01-06 18:48:14.000000000 +0000
@@ -40,10 +40,7 @@
 # Makefile for the HAL-based Atheros driver.
 #
 
-ifeq ($(obj),)
-obj=	.
-endif
-
+obj := $(firstword $(obj) $(SUBDIRS) .)
 TOP = $(obj)
 
 ifneq (svnversion.h,$(MAKECMDGOALS))
diff -Naur madwifi-0.9.4.orig/ath/Makefile madwifi-0.9.4/ath/Makefile
--- madwifi-0.9.4.orig/ath/Makefile	2007-07-25 15:23:34.000000000 +0000
+++ madwifi-0.9.4/ath/Makefile	2009-01-06 18:48:13.000000000 +0000
@@ -40,10 +40,7 @@
 # Makefile for the Atheros WLAN driver.
 #
 
-ifeq ($(obj),)
-obj=	.
-endif
-
+obj := $(firstword $(obj) $(SUBDIRS) .)
 TOP = $(obj)/..
 
 ifeq ($(strip $(BUS)),AHB)
diff -Naur madwifi-0.9.4.orig/ath_hal/Makefile madwifi-0.9.4/ath_hal/Makefile
--- madwifi-0.9.4.orig/ath_hal/Makefile	2007-07-25 15:23:34.000000000 +0000
+++ madwifi-0.9.4/ath_hal/Makefile	2009-01-06 18:48:13.000000000 +0000
@@ -40,10 +40,7 @@
 # Makefile for the Atheros WLAN driver.
 #
 
-ifeq ($(obj),)
-obj=	.
-endif
-
+obj := $(firstword $(obj) $(SUBDIRS) .)
 TOP = $(obj)/..
 
 include $(TOP)/Makefile.inc
diff -Naur madwifi-0.9.4.orig/ath_rate/Makefile madwifi-0.9.4/ath_rate/Makefile
--- madwifi-0.9.4.orig/ath_rate/Makefile	2007-12-12 04:11:07.000000000 +0000
+++ madwifi-0.9.4/ath_rate/Makefile	2009-01-06 18:48:13.000000000 +0000
@@ -1,7 +1,4 @@
-ifeq ($(obj),)
-obj=	.
-endif
-
+obj := $(firstword $(obj) $(SUBDIRS) .)
 TOP = $(obj)/..
 
 obj-y := amrr/ onoe/ sample/ minstrel/
diff -Naur madwifi-0.9.4.orig/ath_rate/amrr/Makefile madwifi-0.9.4/ath_rate/amrr/Makefile
--- madwifi-0.9.4.orig/ath_rate/amrr/Makefile	2007-07-25 15:23:34.000000000 +0000
+++ madwifi-0.9.4/ath_rate/amrr/Makefile	2009-01-06 18:48:13.000000000 +0000
@@ -40,10 +40,7 @@
 #
 # Makefile for the Atheros Rate Control Support.
 #
-ifeq ($(obj),)
-obj=	.
-endif
-
+obj := $(firstword $(obj) $(SUBDIRS) .)
 TOP = $(obj)/../..
 
 obj-m		+= ath_rate_amrr.o
diff -Naur madwifi-0.9.4.orig/ath_rate/minstrel/Makefile madwifi-0.9.4/ath_rate/minstrel/Makefile
--- madwifi-0.9.4.orig/ath_rate/minstrel/Makefile	2007-12-12 04:11:07.000000000 +0000
+++ madwifi-0.9.4/ath_rate/minstrel/Makefile	2009-01-06 18:48:13.000000000 +0000
@@ -38,10 +38,7 @@
 #
 # Makefile for the Atheros Rate Control Support.
 #
-ifeq ($(obj),)
-obj=	.
-endif
-
+obj := $(firstword $(obj) $(SUBDIRS) .)
 TOP = $(obj)/../..
 
 obj-m		+= ath_rate_minstrel.o
diff -Naur madwifi-0.9.4.orig/ath_rate/onoe/Makefile madwifi-0.9.4/ath_rate/onoe/Makefile
--- madwifi-0.9.4.orig/ath_rate/onoe/Makefile	2007-07-25 15:23:34.000000000 +0000
+++ madwifi-0.9.4/ath_rate/onoe/Makefile	2009-01-06 18:48:13.000000000 +0000
@@ -40,10 +40,7 @@
 #
 # Makefile for the Atheros Rate Control Support.
 #
-ifeq ($(obj),)
-obj=	.
-endif
-
+obj := $(firstword $(obj) $(SUBDIRS) .)
 TOP = $(obj)/../..
 
 obj-m		+= ath_rate_onoe.o
diff -Naur madwifi-0.9.4.orig/ath_rate/sample/Makefile madwifi-0.9.4/ath_rate/sample/Makefile
--- madwifi-0.9.4.orig/ath_rate/sample/Makefile	2007-07-25 15:23:34.000000000 +0000
+++ madwifi-0.9.4/ath_rate/sample/Makefile	2009-01-06 18:48:13.000000000 +0000
@@ -38,10 +38,7 @@
 #
 # Makefile for the Atheros Rate Control Support.
 #
-ifeq ($(obj),)
-obj=	.
-endif
-
+obj := $(firstword $(obj) $(SUBDIRS) .)
 TOP = $(obj)/../..
 
 obj-m		+= ath_rate_sample.o
diff -Naur madwifi-0.9.4.orig/include/compat.h madwifi-0.9.4/include/compat.h
--- madwifi-0.9.4.orig/include/compat.h	2007-12-13 04:07:54.000000000 +0000
+++ madwifi-0.9.4/include/compat.h	2009-01-06 18:48:13.000000000 +0000
@@ -175,6 +175,13 @@
 #define DEV_ATH CTL_UNNUMBERED
 #endif
 
+/* __skb_append got a third parameter in 2.6.14 */
+#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,14)
+#define __skb_queue_after(_list, _old, _new)	__skb_append(_old, _new)
+#elif LINUX_VERSION_CODE < KERNEL_VERSION(2,6,25)
+#define __skb_queue_after(_list, _old, _new)	__skb_append(_old, _new, _list)
+#endif
+
 #endif /* __KERNEL__ */
 
 #endif /* _ATH_COMPAT_H_ */
diff -Naur madwifi-0.9.4.orig/net80211/Makefile madwifi-0.9.4/net80211/Makefile
--- madwifi-0.9.4.orig/net80211/Makefile	2007-07-25 15:23:34.000000000 +0000
+++ madwifi-0.9.4/net80211/Makefile	2009-01-06 18:48:13.000000000 +0000
@@ -39,10 +39,7 @@
 #
 # Makefile for the 802.11 WLAN modules.
 #
-ifeq ($(obj),)
-obj=	.
-endif
-
+obj := $(firstword $(obj) $(SUBDIRS) .)
 TOP = $(obj)/..
 #
 # There are two authenticator mechanisms: an in-kernel implementation
diff -Naur madwifi-0.9.4.orig/net80211/ieee80211_linux.h madwifi-0.9.4/net80211/ieee80211_linux.h
--- madwifi-0.9.4.orig/net80211/ieee80211_linux.h	2007-08-30 01:59:13.000000000 +0000
+++ madwifi-0.9.4/net80211/ieee80211_linux.h	2009-01-06 18:48:13.000000000 +0000
@@ -238,11 +238,6 @@
 #define	ACL_LOCK_ASSERT(_as)
 #endif
 
-/* __skb_append got a third parameter in 2.6.14 */
-#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,14)
-#define __skb_append(a,b,c)	__skb_append(a,b)
-#endif
-
 /*
  * Per-node power-save queue definitions.  Beware of control
  * flow with IEEE80211_NODE_SAVEQ_LOCK/IEEE80211_NODE_SAVEQ_UNLOCK.
@@ -268,16 +263,16 @@
 	_skb = __skb_dequeue(&(_ni)->ni_savedq);		\
 	(_qlen) = skb_queue_len(&(_ni)->ni_savedq);		\
 } while (0)
-#define	_IEEE80211_NODE_SAVEQ_ENQUEUE(_ni, _skb, _qlen, _age) do {\
-	struct sk_buff *tail = skb_peek_tail(&(_ni)->ni_savedq);\
-	if (tail != NULL) {					\
-		_age -= M_AGE_GET(tail);			\
-		__skb_append(tail, _skb, &(_ni)->ni_savedq);	\
-	} else { 						\
-		__skb_queue_head(&(_ni)->ni_savedq, _skb);	\
-	}							\
-	M_AGE_SET(_skb, _age);					\
-	(_qlen) = skb_queue_len(&(_ni)->ni_savedq); 		\
+#define	_IEEE80211_NODE_SAVEQ_ENQUEUE(_ni, _skb, _qlen, _age) do {	\
+	struct sk_buff *tail = skb_peek_tail(&(_ni)->ni_savedq);	\
+	if (tail != NULL) {						\
+		_age -= M_AGE_GET(tail);				\
+		__skb_queue_after(&(_ni)->ni_savedq, tail, _skb);	\
+	} else { 							\
+		__skb_queue_head(&(_ni)->ni_savedq, _skb);		\
+	}								\
+	M_AGE_SET(_skb, _age);						\
+	(_qlen) = skb_queue_len(&(_ni)->ni_savedq); 			\
 } while (0)
 
 /*
diff -Naur madwifi-0.9.4.orig/net80211/ieee80211_power.c madwifi-0.9.4/net80211/ieee80211_power.c
--- madwifi-0.9.4.orig/net80211/ieee80211_power.c	2008-01-29 09:17:23.000000000 +0000
+++ madwifi-0.9.4/net80211/ieee80211_power.c	2009-01-06 18:48:13.000000000 +0000
@@ -237,7 +237,7 @@
 	tail = skb_peek_tail(&ni->ni_savedq);
 	if (tail != NULL) {
 		age -= M_AGE_GET(tail);
-		__skb_append(tail, skb, &ni->ni_savedq);
+		__skb_queue_after(&ni->ni_savedq, tail, skb);
 	} else
 		__skb_queue_head(&ni->ni_savedq, skb);
 	M_AGE_SET(skb, age);
